/**
 ----------------------
 1.当前文件用于编辑表单
 2.提供表单相关属性
 3. @param xxxFormConfig.current 指向当前选中的数据
 ----------------------
 */
import type {MonitorJob} from '@/api/modules/monitor/job/types';
import type {Rule} from 'ant-design-vue/es/form/interface';
import {useAxForm} from '@/utils/common/hooks';

const jobFormObj: MonitorJob = {
        jobId: 0 ,
        jobName: "" ,
        jobGroup: "" ,
        invokeTarget: "" ,
        cronExpression: "" ,
        misfirePolicy: "" ,
        concurrent: "" ,
        status: "" ,
        createBy: "" ,
        createTime: null ,
        updateBy: "" ,
        updateTime: null ,
        remark: "" ,
};

// 表格校验
export const jobRules: Record<string, Rule[]> = {
    jobName: [{required: false , trigger: 'change'}],
    jobGroup: [{required: false , trigger: 'change'}],
    invokeTarget: [{required: true, trigger: 'change'}],
    cronExpression: [{required: false , trigger: 'change'}],
    misfirePolicy: [{required: false , trigger: 'change'}],
    concurrent: [{required: false , trigger: 'change'}],
    status: [{required: false , trigger: 'change'}],
    updateBy: [{required: false , trigger: 'change'}],
    updateTime: [{required: false , trigger: 'change'}],
    remark: [{required: false , trigger: 'change'}],
};
export const jobFormConfig = useAxForm<MonitorJob>(jobFormObj);
export const jobFormRef = ref()